﻿<?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors',1);
date_default_timezone_set('Asia/ShangHai'); 

set_include_path('.'.PATH_SEPARATOR.'../include/'.PATH_SEPARATOR.'../application/models'.PATH_SEPARATOR.get_include_path());
include "Zend/Loader/AutoLoader.php";
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);

$config=new Zend_Config_Ini('../setting.ini','development');
Zend_Registry::set('config',$config);

$params=array('host'=>$config->database->hostname,
               'username'=>$config->database->username,
			   'password'=>$config->database->password,
			   'dbname'=>$config->database->database);			   
$db=Zend_Db::factory($config->database->type,$params);
Zend_Registry::set('db',$db);

$frontController=Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('../include/Controllers');

$vr=new Zend_Controller_Action_Helper_ViewRenderer();
$vr->setView(new Templater());
$vr->setViewSuffix('tpl');
Zend_Controller_Action_HelperBroker::addHelper($vr);
$frontController->dispatch();

